home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <stdio.h>
- #include <string.h>
-
- struct User {
- char Name[31],Pass[9],Location[30],PhoneNumber[13];
- USHORT Slot_Number;
- USHORT Sec_Status,
- Sec_Board, /* File or Byte Ratio */
- Sec_Library, /* Ratio */
- Sec_Bulletin, /* Computer Type */
- Messages_Posted;
- /* Note ConfYM = the last msg you actually read, ConfRead is the same ?? */
- ULONG NewSinceDate, ConfRead1, ConfRead2, ConfRead3, ConfRead4,
- ConfRead5, ConfRead6, ConfRead7, AccountDate;
- UWORD ScreenType, Filler1;
- char Conference_Access[10];
- USHORT Uploads, Downloads, ConfRJoin, Times_Called;
- long Time_Last_On, Time_Used, Time_Limit, Time_Total;
- ULONG Bytes_Download, Bytes_Upload, Daily_Bytes_Limit, Daily_Bytes_Dld;
- char Expert;
- ULONG ConfYM1, ConfYM2, ConfYM3, ConfYM4, ConfYM5, ConfYM6, ConfYM7,
- ConfYM8, ConfYM9;
- long BeginLogCall;
- UBYTE Protocol, UUCPA, LineLength, New_User;
- };
-
- char username[200];
- void sr(char *s);
- char newusername[200];
- char oldusername[200];
- main(int argc,char *argv[])
- {
- FILE *fi,*fi2,*fo;
- struct User U;
- struct User N;
- if(argc!=2)
- {
- printf("ConUser version 1.0, written by Joseph Hodge\n");
- printf("usage: ConUser <pathname to userdata>\n");
- printf(" ie: ConUser bbs:User.Data\n");
- printf("\n");
- exit(0);
- }
- strcpy(username,argv[1]);
- sr(username);
- fi=fopen(username,"rb");
- if(fi==NULL)
- {
- printf("Error, can't open %s\n",username);
- printf("\n");
- exit(0);
- }
- strcpy(oldusername,username);
- strcat(oldusername,".old");
- fi2=fopen(oldusername,"rb");
- if(fi2==NULL)
- {
- printf("Error\n");
- fclose(fi);
- exit(0);
- }
- strcat(username,".new");
- fo=fopen(username,"wb");
- while(fread((APTR)&U,sizeof(struct User),1,fi)!=NULL)
- {
- fread((APTR)&N,sizeof(struct User),1,fi2);
- U.Bytes_Download=N.Bytes_Download;
- U.Bytes_Upload=N.Bytes_Upload;
- U.Daily_Bytes_Limit=N.Daily_Bytes_Limit;
- U.Daily_Bytes_Dld=N.Daily_Bytes_Dld;
- U.Uploads=N.Uploads;
- U.Downloads=N.Downloads;
- fwrite((APTR)&U,sizeof(struct User),1,fo);
- }
- fclose(fo);
- fclose(fi);
- fclose(fi2);
- exit(0);
- }
-
- void sr(char *s)
- {
- register int i;
- i=strlen(s)-1;
- while(i>-1)
- {
- if(*(s+i)<=32) *(s+i)='\0'; else break;
- i--;
- }
- }
-